home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 10 / PC Guia 10.iso / database / shared.dir / 01038_Script_1038 < prev    next >
Text File  |  1996-03-14  |  3KB  |  115 lines

  1. on GetWideCaptions start
  2.   global tmplist
  3.   
  4.   set tmplist = []
  5.   set flist = "Filenames"
  6.   set num = the number of lines of field flist
  7.   
  8.   put "Getting maker numbers..."
  9.   repeat with i = 1 to num
  10.     
  11.     set tmp = line i of field flist
  12.     if notempty(tmp) then
  13.       set mnum = nametonum(tmp)  
  14.       add(tmplist,mnum)
  15.     end if
  16.   end repeat
  17.   
  18.   set flist = "Filenames2"
  19.   set num = the number of lines of field flist
  20.   
  21.   repeat with i = 1 to num
  22.     
  23.     set tmp = line i of field flist
  24.     if notempty(tmp) then
  25.       set mnum = nametonum(tmp)  
  26.       add(tmplist,mnum)
  27.     end if
  28.   end repeat
  29.   
  30.   put tmplist
  31.   set tmpcaptions = ""
  32.   set garticles = []
  33.   
  34.   set num = count(tmplist)
  35.   repeat with i = start to num
  36.     set curart = getat(tmplist,i)
  37.     set tt = line 2 of field (curart && "script")
  38.     do tt
  39.     put tt
  40.     put gArticles
  41.     set widecap = the text of field (curart & ".cap-wide")
  42.     set cap = the text of field (curart & ".cap")
  43.     set the itemdelimiter = "@"
  44.     set numchap = count(gArticles)
  45.     set the itemdelimiter = ","
  46.     
  47.     repeat with j = 1 to numchap
  48.       set the itemdelimiter = "@"
  49.       set chap = item j of cap
  50.       set widechap = item j of widecap
  51.       set the itemdelimiter = "#"
  52.       set numart = count(getat(gArticles,j))
  53.       set the itemdelimiter = ","
  54.       set tmpchapter = ""
  55.       
  56.       repeat with k = 1 to numart 
  57.         set the itemdelimiter = "#"
  58.         set thinarticle = item k of chap  
  59.         set widearticle = item k of widechap
  60.         set the itemdelimiter = ","
  61.         
  62.         set article = curart &"-"&j&"." & k
  63.         set numarticle = the number of cast article
  64.         
  65.         put article && numarticle
  66.         set type = getat(getat(gArticles,j),k)
  67.         put "type = " && type
  68.         
  69.         if type contains "pic" then
  70.           if numarticle > 0 then
  71.             if the width of cast numarticle > the height of cast numarticle then
  72.               put "wide!"
  73.               -- put widearticle
  74.               set thinarticle = widearticle
  75.             else
  76.               put "thin!"
  77.               -- put thinarticle
  78.             end if
  79.           end if
  80.         else if type contains "movie" then
  81.           set thinarticle = widearticle
  82.         end if
  83.         set the itemdelimiter = "#"
  84.         put thinarticle into item k of tmpchapter
  85.         set the itemdelimiter = ","
  86.       end repeat
  87.       set the itemdelimiter = "@"
  88.       put tmpchapter into item j of tmpcaptions
  89.       set the itemdelimiter = ","
  90.     end repeat
  91.     put tmpcaptions
  92.     put tmpcaptions into field (curart & ".cap-fixed")
  93.   end repeat
  94. end
  95.  
  96.  
  97. -- adds "name" to the end of the name
  98. on widefixnames start,end
  99.   
  100.   repeat with i = start to end
  101.     set tmpname = string(the name of cast i)
  102.     put "0ld " && tmpname
  103.     set the itemdelimiter = "."
  104.     set n = item 1 of tmpname
  105.     set the itemdelimiter = ","
  106.     
  107.     
  108.     set tmpname = n & ".cap"
  109.     set the name of cast i = tmpname
  110.     put "new" && tmpname
  111.   end repeat
  112.   
  113. end
  114.  
  115.